var countNodes = function (root) {
    if (root === null) {
        return 0
    }

    let left = countNodes(root.left)
    let right = countNodes(root.right)
    let result = left + right + 1
    return result
};